#include <stdint.h>
#include "gd32f30x.h"
#include "led_drv.h"
#include "key_drv.h"
#include "systick.h"

int main(void)
{
	uint8_t keyVal;
	
	SystickInit();
	LedDrvInit();
	KeyDrvInit();
	
	while (1)
	{
		keyVal = GetKeyVal();
		switch (keyVal)
		{
			case KEY1_SHORT_PRESS:
				TurnOnLed(LED1);
				break;
			case KEY1_LONG_PRESS:
				TurnOffLed(LED1);
				break;
			case KEY2_SHORT_PRESS:
				TurnOnLed(LED2);
				break;
			case KEY2_LONG_PRESS:
				TurnOffLed(LED2);
				break;
			case KEY3_SHORT_PRESS:
				TurnOnLed(LED3);
				break;
			case KEY3_LONG_PRESS:
				TurnOffLed(LED3);
				break;
			default:
				break;
		}
	}
}
